package phoenix.web.test_suites.flirt.critical;

import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import phoenix.core.base.TestSuiteBase;
import phoenix.core.data_models.TestUserDataModel;
import phoenix.web.test_objects.NaughtyModeTests;
import phoenix.web.test_objects.data_model.NaughtyMode;

public class NaughtyModeTS extends TestSuiteBase
{
	private final NaughtyModeTests naughtyTests = new NaughtyModeTests(phoenix);

	@DataProvider
	public Object[][] searchPageData()
	{
		return naughtyTests.dataProviders.searchPageData();
	}

	@BeforeClass
	public void setUp()
	{
		TestUserDataModel p_user = db().getUserBy(testModel().getSiteName(), 1, "female");
		phoenix.setTestUser(p_user.getId());
		phoenix.backend().searchPage().unsetUserAsScammer(testUser());
	}

	@Test(dataProvider = "searchPageData", priority = 1, enabled = true)
	public void searchNaughtyTest(TestUserDataModel p_userID, NaughtyMode p_expectedMode)
	{
		naughtyTests.searchNaughtyTest(p_userID, p_expectedMode, NaughtyMode.NORMAL);
	}

	@Test(dataProvider = "searchPageData", priority = 2, enabled = true)
	public void profileNaughtyTest(TestUserDataModel p_user, NaughtyMode p_expectedMode)
	{
		naughtyTests.userProfileNaughtyTest(p_user, p_expectedMode, NaughtyMode.NORMAL);
	}

	@Test(dataProvider = "searchPageData", priority = 3, enabled = true)
	public void notificationNaughtyTest(TestUserDataModel p_user, NaughtyMode p_expectedMode)
	{
		naughtyTests.notificationsNaughtyTest(p_user, p_expectedMode, NaughtyMode.NORMAL);
	}

	//https://redmine.platformphoenix.com/issues/137176
	@Test(dataProvider = "searchPageData", priority = 4, enabled = true)
	public void galleryNaughtyTest(TestUserDataModel p_user, NaughtyMode p_expectedMode)
	{
		naughtyTests.galleryNaughtyTest(p_user, p_expectedMode, NaughtyMode.NORMAL);
	}

	@Test(dataProvider = "searchPageData", priority = 5, enabled = true)
	public void switcherNaughtyTest(TestUserDataModel p_user, NaughtyMode p_expectedMode)
	{
		naughtyTests.switcherNaughtyTest(p_user, p_expectedMode);
	}
}
